package teamGiga.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import teamGiga.bean.MovieMemberBean;
import teamGiga.bean.ShoppingBean;
import teamGiga.dao.CartDao;
import action.servlet.ActionForWard;

public class VodInfoAction extends Action{

	private String path;
	private boolean redirect;
	public VodInfoAction(String path, boolean redirect) {
		super();
		this.path = path;
		this.redirect = redirect;
	}
	public VodInfoAction() {
		super();
	}
	
	
	@Override
	public ActionForWard execute(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		
		try {
			String no = request.getParameter("no");
			request.setAttribute("Info", CartDao.selectInfoMovie(Integer.parseInt(no)));
			MovieMemberBean bean=(MovieMemberBean)request.getSession().getAttribute("memberBean");
			int mbno=bean.getMbno();
			List<ShoppingBean>list=CartDao.selectshopping(mbno);
			request.setAttribute("Shoppinglist", list);
			
		} catch (Exception e) {
			// TODO: handle exception
		}
		
		
		
		return new ActionForWard(path, redirect);
	}
	
	
	
}
